package com.test.utils;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

public class IOUtil
{
	/**
	 * 读出输入流-->字符串
	 * 
	 * @param is
	 * @return
	 * @throws IOException
	 */
	public static String readString( InputStream is ) throws IOException
	{
		StringBuffer buffer = new StringBuffer();
		BufferedReader reader = new BufferedReader( new InputStreamReader( is ) );
		String line;
		while ( ( line = reader.readLine() ) != null )
		{
			buffer.append( line );
		}
		return buffer.toString();
	}
}
